#include "exynos_4412.h"

#define TIME 1000000
void delay(unsigned int time);
int main()
{
	//LED2 CONFIG
	GPX2.CON = GPX2.CON & (~(0xF << 28)) | (0x1 << 28);
	//LED3 CONFIG
	GPX1.CON = GPX1.CON & (~0xF) | 0x1;
	//LED4 CONFIG
	GPF3.CON = GPF3.CON & (~(0xF << 16)) | (0x1 << 16);
	//LED5 CONFIG
	GPF3.CON = GPF3.CON & (~(0xF << 20)) | (0x1 << 20);

	while (1)
	{
		//turn on LED2
		GPX2.DAT = GPX2.DAT | (1 << 7);
		//delay
		delay(TIME);
		//turn off LED2
		GPX2.DAT = GPX2.DAT & (~(1 << 7));
		//turn on LED3
		GPX1.DAT = GPX1.DAT | 1;
		//delay
		delay(TIME);
		//turn off LED3
		GPX1.DAT = GPX1.DAT & (~1);
		//turn on LED4
		GPF3.DAT = GPF3.DAT | (1 << 4);
		//delay
		delay(TIME);
		//turn off LED4
		GPF3.DAT = GPF3.DAT & (~(1 << 4));
		//turn on LED5
		GPF3.DAT = GPF3.DAT | (1 << 5);
		//delay
		delay(TIME);
		//turn off LED5
		GPF3.DAT = GPF3.DAT & (~(1 << 5));
	}
	return 0;
}

void delay(unsigned int time)
{
	while (time--);
}
